using UnityEngine;

public class EditorTemporary : MonoBehaviour
{
	public bool lateDestroy;

	private bool firstUpdate = true;

	private void Start()
	{
		if (!lateDestroy)
		{
			DestroyIfNotEditor();
		}
	}

	private void Update()
	{
		if (firstUpdate)
		{
			if (lateDestroy)
			{
				DestroyIfNotEditor();
			}
			firstUpdate = false;
		}
	}

	private void DestroyIfNotEditor()
	{
		if (!Application.isEditor || Application.isPlaying)
		{
			Object.Destroy(base.gameObject);
		}
	}
}
